<template>
    <div class="games">
        <ul>
            <li v-for="g in musicList" :key="g.code">{{ g.data.name }} </li>
        </ul>
        <button @click="getMusic">获取音乐</button>
    </div>
</template>

<script setup lang="ts" name="Games">
import { useTalkStore } from '@/store/games';
import { storeToRefs } from 'pinia';

const musicStore=useTalkStore()
const {musicList}=storeToRefs(musicStore)

async function getMusic( ) {
    musicStore.getMusic()
}

</script>

<style scoped>
.games{
    background-color: skyblue;
    border-radius: 10px;
    box-shadow: 0 0 10px;
    padding: 10px;
    width: 200px;
    height: 300px;
}
</style>
